#include <STC89C5xRC.H>

typedef unsigned char u8;
typedef unsigned int u16;

void Delay1ms(u16 n);

void main () {
	u8 temp = 1;
	while(1) {
		P0 = ~temp;
		temp <<= 1;
		if (temp == 0) {
			temp =1;
		}
		Delay1ms(500);
		
	}
	
}

void Delay1ms(u16 n)		//@11.0592MHz
{
	unsigned char data i, j;
	while(n > 0) {
		i = 2;
		j = 199;
		do
		{
			while (--j);
		} while (--i);
		n--;
	}
}
